<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>


<%@page import="java.sql.*"%>

<%
String username=request.getParameter("username");
String pswd=request.getParameter("pswd");
 Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/database name"," "," ");  
           Statement st=con.createStatement();
           ResultSet rs=st.executeQuery("select * from login where username='"+username+"' and pswd='"+pswd+"'");
int count=0;
          while(rs.next())
          {

                   count++;
          }

                    if(count>0)
          {
            out.println("welcome "+username);
          }
          else
          {
                       response.sendRedirect("login.jsp");
          }
%>
</head>
<body>

</body>
</html>